package com.alex.seo.service.campaign.executor.publishing;

import com.alex.seo.contentsource.NoContentException;
import com.alex.seo.service.scheduler.JobScheduler;

public class TestJobScheduler implements JobScheduler {

	@Override
	public Integer scheduleJob(int count) {
		if (count == 0) {
			return 0;
		} else if (count >= 5) {
			return null;
		} else {
			return count * 1000;
		}
	}

	@Override
	public Integer rescheduleJobOnError(Throwable t, int errorCount) {
		if (t instanceof NoContentException) {
			return 20 * 1000;
		} else {
			return 10 * 1000;
		}
	}

}
